USE [GLP]
GO

/****** Object:  View [dbo].[App_descuentos]    Script Date: 10/24/2012 11:34:18 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create view [dbo].[App_descuentos] as
select lp.id_lista, lp.nombre as nm_lista, 
	de.id_desrec, de.id_rubro, de.id_categ_art, de.id_articulo, de.porcentaje, de.signo, de.orden_aplica,
	art.codigo, art.precio,
	art.id_rubro as art_rubro, art.id_categ_art as art_categ, art.id_articulo as art_id
from app_lista lp
	join App_desrec de on de.id_lista = lp.id_lista
	join App_articulo art on art.id_rubro = de.id_rubro or art.id_categ_art = de.id_categ_art or art.id_articulo = de.id_articulo
--where lp.id_lista=103
--order by lp.id_lista, art.codigo, de.orden_aplica
GO


